fix: align ApiException with other SDKs and fix body reading#118
Merged
fix: align ApiException with other SDKs and fix body reading#118
Conversation
b35859d to
888a343
Compare
888a343 to
39b7eed
Compare
github-actions Bot
pushed a commit
that referenced
this pull request
Mar 11, 2026
# [4.1.0-beta.16](v4.1.0-beta.15...v4.1.0-beta.16) (2026-03-11) ### Bug Fixes * align ApiException with other SDKs and fix body reading ([#118](#118)) ([cbb4e65](cbb4e65))
github-actions Bot
pushed a commit
that referenced
this pull request
Mar 17, 2026
# [4.1.0](v4.0.0...v4.1.0) (2026-03-17) ### Bug Fixes * add correct package exports and build for git installs ([#102](#102)) ([f67dcd6](f67dcd6)) * align ApiException with other SDKs and fix body reading ([#118](#118)) ([cbb4e65](cbb4e65)) * correct sed regex in release config to match prerelease suffixes ([f367d08](f367d08)) * **deps:** resolve npm audit vulnerabilities ([5d33e84](5d33e84)) * **deps:** resolve npm audit vulnerabilities ([39c3b10](39c3b10)) * **deps:** resolve npm audit vulnerabilities ([af410bd](af410bd)) ### Features * add TransportOptions for configuring TLS, proxy, and default headers ([#114](#114)) ([b048d51](b048d51)) * configure semantic-release to publish package to GitHub Packages ([c282f98](c282f98)) * **node:** upgrade runtime to Node.js 22, update tooling and dependencies ([783a0ee](783a0ee)) * renamed the package to zitadel/sdk since the other names are reserved. ([eb414bd](eb414bd)) * renamed the package to zitadel/sdk since the other names are reserved. ([724dff9](724dff9)) * **sdk:** generate SDK for version v4.0.0 ([#71](#71)) ([4253292](4253292)) * **sdk:** generate SDK for version v4.1.3 ([#74](#74)) ([3a3a8e7](3a3a8e7)) * **sdk:** generate SDK for version v4.11.0 ([#111](#111)) ([faf8927](faf8927)) * **sdk:** generate SDK for version v4.2.0 ([#75](#75)) ([2bdccb1](2bdccb1)) * **sdk:** generate SDK for version v4.3.0 ([#77](#77)) ([83fc05b](83fc05b))
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #113
Description
Aligned
ApiExceptionwith the Java, Ruby, and Python SDKs by removing themessageconstructor parameter and building the message internally as"Error <code>". Also removed the redundantgetStatusCode()method (callers use inheritedgetCode()instead) and fixed a bug where the response body was never actually read from theReadableStream(response?.body?.toString()gave"[object ReadableStream]"instead of the actual body content).Related Issue
#83
Motivation and Context
The Node SDK's
ApiExceptiondiverged from the other SDKs in three ways: it took amessageparameter instead of building it internally, it had a redundantgetStatusCode()accessor, and it never consumed the response body stream. This made the exception less useful for debugging (the body was always"[object ReadableStream]") and inconsistent with the other client libraries.How Has This Been Tested?
All 36 existing tests pass, including the updated unit test for
ApiExceptionand the integration tests that exercise the full request/error path against a real Zitadel instance via Docker Compose.Documentation:
N/A
Checklist: